var path = require('path');

var LOG_LEVEL = process.env.LOG_LEVEL || 'info';
var HOST = process.env.HOST || 'localhost';
var PORT = process.env.PORT || '5000';
var org = process.env.org || "org1";
var peer = process.env.peer || "peer1";
var ordererOrg = process.env.ordererOrg || "org1";
var ordererId = process.env.ordererId || "orderer1";
var chaincodePath = "go/cbsp";
var chaincodeVersion = "1.0";
var channelName = "mychannel";
var chaincodeId = "mycc";
var networkConfigName = process.env.NETWORK_CONFIG_NAME || 'network-config.json';
var networkConfigPath = process.env.NETWORK_CONFIG_PATH || __dirname;
var channelTxPath = process.env.CHANNEL_TX_PATH || path.join(__dirname, 'channel/channel-artifacts');
var channelTxName = process.env.CHANNEL_TX_NAME || 'channel.tx';
var caClientEnable = process.env.CA_CLIENT_ENABLE == "true" ? true : false;
var chaincodeType = process.env.CHAINCODE_TYPE || 'golang';
var listenTransactionEvents = process.env.LISTEN_TRANSACTION_EVENTS == "false" ? false : true;
var gopath = process.env.GOPATH || '/app/cbsp/chaincode'

var config = {
  LOG_LEVEL: LOG_LEVEL,
  HOST: HOST,
  PORT: PORT,
  ORG: org,
  PEER: peer,
  ORDERER_ORG: ordererOrg,
  ORDERER_ID: ordererId,
  CHAINCODE_PATH: chaincodePath,
  CHAINCODE_VERSION: chaincodeVersion,
  CHANNEL_NAME: channelName,
  CHAINCODE_ID: chaincodeId,
  NETWORK_CONFIG_NAME: networkConfigName,
  NETWORK_CONFIG_PATH: networkConfigPath,
  CHANNEL_TX_PATH: channelTxPath,
  CHANNEL_TX_NAME: channelTxName,
  CA_CLIENT_ENABLE: caClientEnable,
  CHAINCODE_TYPE: chaincodeType,
  LISTEN_TRANSACTION_EVENTS: listenTransactionEvents
}


console.log('The application log level is ' + LOG_LEVEL + '.');
module.exports = config;